Skip to content

fix: persist PlexServerURL to config during --install - #28

Open
danielewood wants to merge 3 commits into
mainfrom
fix/persist-plex-url-on-install
Open

fix: persist PlexServerURL to config during --install#28
danielewood wants to merge 3 commits into
mainfrom
fix/persist-plex-url-on-install

Conversation

@danielewood

Copy link
Copy Markdown
Owner

Summary

  • The PLEX_URL argument passed to --install was only written into the systemd service file (ExecStart for cloudflared) but never persisted to plexargod.conf
  • On new installations, PlexServerURL would always fall back to http://localhost:32400 regardless of what URL was passed during install
  • Now creates the config directory and writes PlexServerURL to plexargod.conf during --install

Closes #27

Test plan

  • Run plexargod --install http://custom-host:32400 and verify PlexServerURL=http://custom-host:32400 appears in /etc/plexargod/plexargod.conf
  • Run plexargod --install (no URL) and verify PlexServerURL=http://localhost:32400 is written to conf
  • Run --install again with a different URL and verify the existing PlexServerURL is updated (not duplicated)

🤖 Generated with Claude Code

The PLEX_URL argument passed to --install was only used in the systemd
service file but never written to plexargod.conf. On new installations,
PlexServerURL would fall back to localhost:32400 regardless of what was
passed during install.

Closes #27

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a93d918379

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plexargod.sh Outdated
Comment on lines +41 to +44
if grep -q "^PlexServerURL=" /etc/plexargod/plexargod.conf 2>/dev/null; then
sed -i "s|^PlexServerURL=.*|PlexServerURL=${PLEX_URL}|" /etc/plexargod/plexargod.conf
else
echo "PlexServerURL=${PLEX_URL}" >> /etc/plexargod/plexargod.conf

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Quote PlexServerURL before persisting it to sourced config

When --install is run with a URL containing shell metacharacters (for example $(...), backticks, or & in a query string), these lines write it verbatim into /etc/plexargod/plexargod.conf. Later the script does source "${plexargod_conf}" at plexargod.sh:100-102, so Bash evaluates that text as code/root shell syntax instead of loading it as data. At minimum this breaks legitimate URLs with &, and in the worst case it allows unintended command execution the next time plexargod runs.

Useful? React with 👍 / 👎.

danielewood and others added 2 commits March 23, 2026 16:03
The conf file is sourced by bash, so unquoted URLs containing shell
metacharacters (& $ backticks) would be interpreted as code. Single-quote
the value to ensure it is treated as a literal string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PlexServerURL is not defined on new installations

1 participant